package com.company.笔试.TreeMapAndLinkedHashMap;

import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;

/**
 * @Classname MyLinkedHashMap
 * @Description TODO
 * @Date 2021/7/30 21:37
 * @Created by ylr
 */
public class MyLinkedHashMap {
    public static void main(String[] args) {
        Map map = new LinkedHashMap();

        map.put(6, "apple");

        map.put(3, "banana");

        map.put(2,"pear");

        for (Iterator it = map.keySet().iterator(); it.hasNext();)

        {
            Object key = it.next();

            System.out.println( key+"="+ map.get(key));

        }
    }
}
